<?php
session_start();
include_once('includes/db.php');
$id = $_GET['id'];
$str = "SELECT * FROM `article` WHERE id = '$id'";
$result = mysql_query($str);
$row = mysql_fetch_array($result);
header("Content-Type: application/octet-stream; ");
$title=$row['title'];
$title=str_replace(' ','_',$title);
header("Content-disposition: attachment;filename=".$title.".txt");
echo $row['title']."\n\r";
echo $row['article']; 
?>
